class Rem {
    constructor() {
        this.render();
    }
    render() {
        var SCREENTYPE = 'orientationchange' in window ? 'orientationchange' : 'resize';
        var DEFINENUMBER = 10;

        function setView() {
            var gg = document.documentElement;
            var width = gg.clientWidth;
             var wmax = 720;
            // var wmax = 430;
            if (gg.clientWidth > wmax) {
                // width = 720;
                // width = wmax;
            } else if (gg.clientWidth < 320) {
                width = 320;
            }
            gg.style.fontSize = width / DEFINENUMBER + 'px';
            return setView;
        }
        window.addEventListener(SCREENTYPE, setView());
        document.addEventListener('touchstart', function (event) {
            if (event.touches.length > 1) {
                event.preventDefault();
            }
        })
        var lastTouchEnd = 0;
        document.addEventListener('touchend', function (event) {
            var now = (new Date()).getTime();
            if (now - lastTouchEnd <= 300) {
                event.preventDefault();
            }
            lastTouchEnd = now;
        }, false);
    }
}
new Rem();
var Storage = {};
Storage.get = function (name) {
    var ret = JSON.parse(localStorage.getItem(name))
    if (typeof (ret) == 'undefined' || null == ret) {
        ret = {}
    }
    return ret
}

Storage.set = function (name, val) {
    localStorage.setItem(name, JSON.stringify(val))
}
